<?php
/**
 * Smarty plugin
 *
 * This plugin is only for Smarty2 BC
 * @package Smarty
 * @subpackage PluginsFunction
 */

/**
 * Smarty {tpgetheader} function plugin //获取头部信息 关键字 描述 title等
 *
 * Type:     function<br>
 * Name:     math<br>
 * Purpose:  handle math computations in template
 *
 * @link http://www.smarty.net/manual/en/language.function.math.php {math}
 *          (Smarty online manual)
 * @author   selenium
 * @param array                    $params   parameters
 * @param Smarty_Internal_Template $template template object
 * @return string|null
 */

 /*
 * 栏目SEO头部调用
 *
 * @access  public
 * @param   $sid  int     当前站点id
 * @param   $cid  int     当前页面栏目id
 * @param   $id   int     是否为内容页(非0即是)
 * @return        string  返回头部区域代码
 */
function smarty_function_tpgetheader($params, $template)
{
	if(empty($params))
	{
		$sid=1;
		$cid=0;
		$id=0;
		$str='';
	}
	else
	{
		$sid = isset($params['sid'])?$params['sid']:1;
		$cid = isset($params['cid'])?$params['cid']:0;
		$id = isset($params['id'])?$params['id']:0;
		$str = isset($params['str'])?$params['str']:'';
	}
	return GetHeader($sid,$cid,$id,$str);
}
?>